$(function () {
   var memberHtml = '<a class="btn2 mr5" href="' + WapSiteUrl + '/tmpl/member/member.html?act=member">用户中心</a>';
    /*var act = GetQueryString("act");
    if (act && act == "member") {
        memberHtml = '<a class="btn mr5" id="logoutbtn" href="javascript:void(0);">注销账号</a>';
    }
     */
    var tmpl = '<div class="footer">'

        + '<div class="footer-content">'
        + '<p class="link">'
        + '<a href="' + WapSiteUrl + '">首页</a>'
        + '<a href="javascript:location.reload(true);" class="">刷新</a>'
        + '</p>'
        /*+ '<p class="copyright">'
        + '版权所有 2014-2015 © 网店交流www.080c.com'
        + '</p>'*/
        + '</div>'
        + '</div>';
    var render = template.compile(tmpl);
    var html = render();
    $("#footer").html(html);

    //回到顶部
    $(".gotop").click(function () {
        $(window).scrollTop(0);
    });
    /*
    var key = getcookie('key');
    $('#logoutbtn').click(function () {
        var username = getcookie('username');
        var key = getcookie('key');
        var client = 'weixin';
        $.ajax({
            type: 'get',
            url: ApiUrl + '/index.php?act=logout',
            data: {username: username, key: key, client: client},
            success: function (result) {
                if (result) {
                    delCookie('username');
                    delCookie('key');
                    delCookie('share');
                    location.href = WapSiteUrl + '/tmpl/member/login.html';
                }
            }
        });
     });*/

    var act = GetQueryString("act");
    if (act && act == "member") {
        memberHtml = '<a id="logoutbtn" href="javascript:void(0);">注销账号</a>';
        $("#footer .footer-content p.link").append(memberHtml);
    }
    var float_menu = $(".bs_float_menu");
    if(float_menu.length >0){
        var html = '<a href="javascript:location.reload(true);"><span class="">R</span></a>'
            +'<a href="'+WapSiteUrl+'"><span class="wicon-home"></span></a>';

        float_menu.html(html);
    }

    var key = getcookie('key');
    $('#logoutbtn').click(function () {
        logout(window.location.href);
    });

    if (window.wx) {
        wxJsSdk();
        wx.config({
            debug: false,
            appId: getcookie('appid'),
            timestamp: getcookie('timestamp'),
            nonceStr: getcookie('noncestr'),
            signature: getcookie('signature'),
            jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'hideOptionMenu', 'showOptionMenu']
        });
    }

    $(document).ready(function () {
        bind4ChangHref();
    });


});
hideOptionMenus();
